<template>
    <div class="breadcrumb">
        <el-button class="btn1" icon="el-icon-s-fold" size="mini" @click.native="handleMenu()"></el-button>
        <el-breadcrumb separator="/" class="bread1">
            <el-breadcrumb-item v-for="item in breadcrumbList" :key="item.index">{{ item.meta.title }}</el-breadcrumb-item>
        </el-breadcrumb>
        <div class="searchBox">
            <el-button icon="el-icon-search" class="btn1" size="mini" ></el-button>
            <el-button icon="el-icon-full-screen" class="btn1" size="mini" ></el-button>
            <el-button icon="el-icon-position" class="btn1" size="mini" ></el-button>
            <el-dropdown :hide-on-click="false">
  <span class="el-dropdown-link" style="font-size: 20px;">
    门诊医生<i class="el-icon-arrow-down el-icon--right"></i>
  </span>
  <el-dropdown-menu slot="dropdown">
    <el-dropdown-item>个人中心</el-dropdown-item>
    <el-dropdown-item disabled>双皮奶</el-dropdown-item>
    <el-dropdown-item divided  @click="loginOut()">退出登录</el-dropdown-item>
  </el-dropdown-menu>
</el-dropdown>
        </div>
    </div>
</template>

<script>
export default {
    name: "Header",
    data() {
        return {
            breadlitst: []
        }
    },
    methods: {
        handleMenu(){
            this.$store.commit('collapseMenu')
        },
        loginOut(){
            localStorage.clear;
            console.log("清除本地存储")
        }

    }, computed: {
        breadcrumbList() {
            return this.$route.matched
            //导航matched根据路由等级数组
        },

    }, mounted() {
        console.log(this.$route)
    }


}
</script>



<style scoped>
.breadcrumb {
    margin-top: 10px;
}
.bread1{
    margin-left: 7px;
    display: inline-block;
    padding-top: 10px;
}
.btn1 {
    border: 0;
    font-size: 20px;
}
.btn2 {
    border: 0;
    font-size: 20px;
}
.searchBox {
    float: right;
}
</style>